home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / top.z / top
Text File  |  1998-10-20  |  19KB  |  463 lines

  1.  
  2.  
  3.  
  4. TTTTOOOOPPPP((((1111))))                                                                  TTTTOOOOPPPP((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      top - display and update information about the top cpu processes
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ttttoooopppp [ ----SSSSbbbbiiiiIIIInnnnqqqqTTTTuuuu ] [ ----dddd_c_o_u_n_t ] [ ----ssss_t_i_m_e ] [ ----oooo_f_i_e_l_d ] [ ----UUUU_u_s_e_r_n_a_m_e ] [
  13.      _n_u_m_b_e_r ]
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      _T_o_p displays the top processes on the system and periodically updates
  17.      this information.  If standard output is an intelligent terminal (see
  18.      below) then as many processes as will fit on the terminal screen are
  19.      displayed by default.  Otherwise, a good number of them are shown (around
  20.      20).  Raw cpu percentage is used to rank the processes.  If _n_u_m_b_e_r is
  21.      given, then the top _n_u_m_b_e_r processes will be displayed instead of the
  22.      default.
  23.  
  24.      _T_o_p makes a distinction between terminals that support advanced
  25.      capabilities and those that do not.  This distinction affects the choice
  26.      of defaults for certain options.  In the remainder of this document, an
  27.      "intelligent" terminal is one that supports cursor addressing, clear
  28.      screen, and clear to end of line.  Conversely, a "dumb" terminal is one
  29.      that does not support such features.  If the output of _t_o_p is redirected
  30.      to a file, it acts as if it were being run on a dumb terminal.
  31.  
  32. OOOOPPPPTTTTIIIIOOOONNNNSSSS
  33.      ----SSSS   Show system processes in the display.  The definition of system
  34.           processes is system dependent (See below).
  35.  
  36.      ----bbbb   Use "batch" mode.  In this mode, all input from the terminal is
  37.           ignored.  Interrupt characters (such as ^C and ^\) still have an
  38.           effect.  This is the default on a dumb terminal, or when the output
  39.           is not a terminal.
  40.  
  41.      ----iiii   Use "interactive" mode.  In this mode, any input is immediately read
  42.           for processing.  See the section on "Interactive Mode" for an
  43.           explanation of which keys perform what functions.  After the command
  44.           is processed, the screen will immediately be updated, even if the
  45.           command was not understood.  This mode is the default when standard
  46.           output is an intelligent terminal.
  47.  
  48.      ----IIII   Do (or do not) display idle processes (toggle).  By default, top
  49.           displays only active (ready to run or running on a processor)
  50.           processes.
  51.  
  52.      ----nnnn   Use "non-interactive" mode.  This is indentical to "batch" mode.
  53.  
  54.      ----qqqq   Renice _t_o_p to -20 so that it will run faster.  This can be used when
  55.           the system is being very sluggish to improve the possibility of
  56.           discovering the problem.  This option can only be used by root.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTOOOOPPPP((((1111))))                                                                  TTTTOOOOPPPP((((1111))))
  71.  
  72.  
  73.  
  74.      ----TTTT   List data for individual kernel threads.  Normally the information
  75.           presented is a summation across all threads of the process.  This is
  76.           of use when examining POSIX threaded processes.
  77.  
  78.      ----uuuu   Do not take the time to map uid numbers to usernames.  Normally, _t_o_p
  79.           will read as much of the file "/etc/passwd" as is necessary to map
  80.           all the user id numbers it encounters into login names.  This option
  81.           disables all that, while possibly decreasing execution time.  The
  82.           uid numbers are displayed instead of the names.
  83.  
  84.      ----dddd_c_o_u_n_t
  85.           Show only _c_o_u_n_t displays, then exit.  A display is considered to be
  86.           one update of the screen.  This option allows the user to select the
  87.           number of displays he wants to see before _t_o_p automatically exits.
  88.           For intelligent terminals, no upper limit is set.  The default is 1
  89.           for dumb terminals.
  90.  
  91.      ----ssss_t_i_m_e
  92.           Set the delay between screen updates to _t_i_m_e seconds.  The default
  93.           delay between updates is 4 seconds.
  94.  
  95.      ----oooo_f_i_e_l_d
  96.           Sort the process display area on the specified field.  The field
  97.           name is the name of the column as seen in the output, but in lower
  98.           case.  Likely values are "cpu", "size", "res", and "time", but may
  99.           vary on different operating systems.  Note that not all operating
  100.           systems support this option.
  101.  
  102.      ----UUUU_u_s_e_r_n_a_m_e
  103.           Show only those processes owned by _u_s_e_r_n_a_m_e.  This option currently
  104.           only accepts usernames and will not understand uid numbers.
  105.  
  106.      Both _c_o_u_n_t and _n_u_m_b_e_r fields can be specified as "infinite", indicating
  107.      that they can stretch as far as possible.  This is accomplished by using
  108.      any proper prefix of the keywords "infinity", "maximum", or "all".  The
  109.      default for _c_o_u_n_t on an intelligent terminal is, in fact, iiiinnnnffffiiiinnnniiiittttyyyy.
  110.  
  111.      The environment variable TTTTOOOOPPPP is examined for options before the command
  112.      line is scanned.  This enables a user to set his or her own defaults.
  113.      The number of processes to display can also be specified in the
  114.      environment variable TTTTOOOOPPPP.  The options ----IIII, ----SSSS, and ----uuuu are actually
  115.      toggles.  A second specification of any of these options will negate the
  116.      first.  Thus a user who has the environment variable TTTTOOOOPPPP set to "-I" may
  117.      use the command "top -I" to see only active processes.
  118.  
  119. IIIINNNNTTTTEEEERRRRAAAACCCCTTTTIIIIVVVVEEEE MMMMOOOODDDDEEEE
  120.      When _t_o_p is running in "interactive mode", it reads commands from the
  121.      terminal and acts upon them accordingly.  In this mode, the terminal is
  122.      put in "CBREAK", so that a character will be processed as soon as it is
  123.      typed.  Almost always, a key will be pressed when _t_o_p is between
  124.      displays; that is, while it is waiting for _t_i_m_e seconds to elapse.  If
  125.      this is the case, the command will be processed and the display will be
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TTTTOOOOPPPP((((1111))))                                                                  TTTTOOOOPPPP((((1111))))
  137.  
  138.  
  139.  
  140.      updated immediately thereafter (reflecting any changes that the command
  141.      may have specified).  This happens even if the command was incorrect.  If
  142.      a key is pressed while _t_o_p is in the middle of updating the display, it
  143.      will finish the update and then process the command.  Some commands
  144.      require additional information, and the user will be prompted
  145.      accordingly.  While typing this information in, the user's erase and kill
  146.      keys (as set up by the command _s_t_t_y) are recognized, and a newline
  147.      terminates the input.
  148.  
  149.      These commands are currently recognized (^L refers to control-L):
  150.  
  151.      ^^^^LLLL   Redraw the screen.
  152.  
  153.      hhhh or ????
  154.           Display a summary of the commands (help screen).
  155.  
  156.      qqqq    Quit _t_o_p.
  157.  
  158.      dddd    Change the number of displays to show (prompt for new number).
  159.           Remember that the next display counts as one, so typing dddd1111 will make
  160.           _t_o_p show one final display and then immediately exit.
  161.  
  162.      nnnn oooorrrr ####
  163.           Change the number of processes to display (prompt for new number).
  164.  
  165.      ssss    Change the number of seconds to delay between displays (prompt for
  166.           new number).
  167.  
  168.      kkkk    Send a signal ("kill" by default) to a list of processes.  This acts
  169.           similarly to the command _k_i_l_l(1)).
  170.  
  171.      rrrr    Change the priority (the "nice") of a list of processes.  This acts
  172.           similarly to the command _r_e_n_i_c_e(8)).
  173.  
  174.      uuuu    Display only processes owned by a specific username (prompt for
  175.           username).  If the username specified is simply "+", then processes
  176.           belonging to all users will be displayed.
  177.  
  178.      eeee    Display a list of system errors (if any) generated by the last kkkkill
  179.           or rrrrenice command.
  180.  
  181.      iiii    (or IIII)))) Toggle the display of idle processes.
  182.  
  183. TTTTHHHHEEEE DDDDIIIISSSSPPPPLLLLAAAAYYYY
  184.      The actual display varies depending on the specific variant of Unix that
  185.      the machine is running.  This description may not exactly match what is
  186.      seen by top running on this particular machine.  Differences are listed
  187.      at the end of this manual entry.
  188.  
  189.      The top few lines of the display show general information about the state
  190.      of the system, including the last process id assigned to a process (on
  191.      most systems), the three load averages, the current time, the number of
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. TTTTOOOOPPPP((((1111))))                                                                  TTTTOOOOPPPP((((1111))))
  203.  
  204.  
  205.  
  206.      existing processes, the number of processes in each state (sleeping,
  207.      running, starting, zombies, and stopped), and a percentage of time spent
  208.      in each of the processor states (excuting in user mode, executing in
  209.      kernel mode, idle, etc).  It also includes information about physical and
  210.      virtual memory allocation.
  211.  
  212.      The remainder of the screen displays information about individual
  213.      processes.  This display is similar in spirit to _p_s(1) but it is not
  214.      exactly the same.  PID is the process id, PGRP is the process group id,
  215.      USERNAME is the name of the process's owner (if ----uuuu is specified, a UID
  216.      column will be substituted for USERNAME), PRI is the current priority of
  217.      the process, SIZE is the total size of the process (text, data, and
  218.      stack), RES is the current amount of resident memory (both SIZE and RES
  219.      are given in kilobytes), STATE is the current state (one of "sleep",
  220.      "WAIT", "run", "idl", "zomb", or "stop"), TIME is the number of system
  221.      and user cpu seconds that the process has used, WCPU, when displayed, is
  222.      the weighted cpu percentage (this is the same value that _p_s(1) displays
  223.      as CPU), CPU is the raw percentage and is the field that is sorted to
  224.      determine the order of the processes, and COMMAND is the name of the
  225.      command that the process is currently running (if the process is swapped
  226.      out, this column is marked "<swapped>").
  227.  
  228. NNNNOOOOTTTTEEEESSSS
  229.      The "ABANDONED" state (known in the kernel as "SWAIT") was abandoned,
  230.      thus the name.  A process should never end up in this state.
  231.  
  232. AAAAUUUUTTTTHHHHOOOORRRR
  233.      William LeFebvre, EECS Department, Northwestern University
  234.  
  235. EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
  236.      TOP  user-configurable defaults for options.
  237.  
  238. FFFFIIIILLLLEEEESSSS
  239.      /dev/kmem      kernel memory
  240.      /dev/mem       physical memory
  241.      /etc/passwd    used to map uid numbers to user names
  242.      /vmunix        system image
  243.  
  244. BBBBUUUUGGGGSSSS
  245.      The default for ----IIII is "do not show idle processes".  This may be
  246.      confusing if you're expecting _t_o_p to display a screenful of processes by
  247.      default.  To appease folks who can't stand that behavior, I have added
  248.      the ability to set "default" options in the environment variable TTTTOOOOPPPP (see
  249.      the OPTIONS section).  Those who want idle processes displayed need only
  250.      set the environment variable TTTTOOOOPPPP to "-I".
  251.  
  252.      The command name for swapped processes should be tracked down, but this
  253.      would make the program run slower.
  254.  
  255.      As with _p_s(1), things can change while _t_o_p is collecting information for
  256.      an update.  The picture it gives is only a close approximation to
  257.      reality.
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. TTTTOOOOPPPP((((1111))))                                                                  TTTTOOOOPPPP((((1111))))
  269.  
  270.  
  271.  
  272. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  273.      kill(1), ps(1), stty(1), mem(4), renice(8)
  274.  
  275. SSSSGGGGIIII////IIIIRRRRIIIIXXXX NNNNOOOOTTTTEEEESSSS
  276.      Multiprocessor support was added. Both number of CPUs and the CPU-ID for
  277.      running processes are shown.  On MP systems the sum of %CPU (or %WCPU)
  278.      numbers may be higher than 100% (one full CPU utilization) but never
  279.      higher than 100 * the number of CPUs.
  280.  
  281.      The IRIX implementation doesn't _n_l_i_s_t(_2) the kernel to get addresses of
  282.      symbols which makes it less system dependent. All values are retrieved
  283.      using the _s_y_s_m_p(_2), _s_y_s_s_g_i(_2), and _p_r_o_c(_4) interfaces.  The same
  284.      executable should run on any SGI hardware (Uniprocessor, SMP, and S2MP)
  285.      running IRIX 6.2 and up.
  286.  
  287.      "last pid" is not supported.
  288.  
  289.      A process is considered to be a "system" process if it has uid=0 and
  290.      ppid=1. This is a compromise for the sake of backward compatibility.  In
  291.      new IRIX systems many of the traditional "system processes" are
  292.      implemented either within the kernel as threads, or as real-time
  293.      processes.
  294.  
  295.      System processes display can be toggled interactively using the 'S' key.
  296.  
  297.      Idle processes display can be toggled interactively using the 'i' key.
  298.  
  299.      Memory sizes are followed by their units: K (Kilobytes), M (Megabytes), G
  300.      (Gigabytes) or T (Terabytes).
  301.  
  302.      The CPU states are sampled every clock tick and provide a "best estimate"
  303.      of the system CPU activity summed across all processors. On IRIX they
  304.      are:
  305.  
  306.                idle      the cpu was idle and not waiting for anything
  307.                usr       the cpu was executing some user mode code
  308.                ker       the cpu was executing some kernel mode code
  309.                wait      the cpu was idle with some i/o outstanding
  310.                xbrk      the cpu was executing code in a fault path
  311.                intr      the cpu was handling an interrupt
  312.  
  313.      For example: a high "wait" number means that the system is I/O bound. A
  314.      close to 100% "usr" number indicates CPU bound processes with little
  315.      system activity.  "xbrk" and "intr" should be close to 0.0% under normal
  316.      circumstances. Larger numbers may indicate pathologically high low-level
  317.      driver activity, memory shortage (high VM activity) etc.  in which case
  318.      _o_s_v_i_e_w(_1) should give a better picture of the system state.
  319.  
  320.  
  321.      The PRI (priority) field supports advanced IRIX real-time and scheduling
  322.      schemes using the following formats where <pri> is a decimal priority
  323.      number:
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. TTTTOOOOPPPP((((1111))))                                                                  TTTTOOOOPPPP((((1111))))
  335.  
  336.  
  337.  
  338.           +<pri>         Real-Time
  339.                <pri>          Normal (timeshared)
  340.                g<pri>         Gang scheduled
  341.                bc             Batch Critical
  342.                b              Batch
  343.                w              Weightless
  344.  
  345.      On pre 6.4 systems the supported formats are:
  346.  
  347.                +<pri>         Real-Time
  348.                <pri>          Normal (timeshared)
  349.                b<pri>         Batch
  350.  
  351.      For more details on new IRIX scheduling and priorities, see _n_p_r_i(_1),
  352.      _n_i_c_e(_2), _r_e_a_l_t_i_m_e(_5), and all the _s_c_h_e_d__X_X_X(_2) services.
  353.  
  354.      %WCPU (weighted CPU) is a decaying average of %CPU over a longer period
  355.      than just the last sampling period. For short running processes %WCPU
  356.      should be close to %CPU as the two values only diverge over time.
  357.  
  358.      This version of top supports sorting by various fields via the command
  359.      line -o (order) option or the 'o' interactive option.  The aliases 'mem'
  360.      (equivalent to 'size'), and 'rss' (equivalent to 'res') are accepted for
  361.      friendliness.  In addition, the IRIX version of top understands prefixes
  362.      of field names, like '-os', instead of '-osize', to be used.  In case of
  363.      prefix ambiguities, the first one to match will be used.  Use 'h' (help)
  364.      to list the supported orders.
  365.  
  366.      The old IRIX _g_r__t_o_p is now implemented as a perl script on top of the new
  367.      _t_o_p to reduce bloat. In addition to the -Bcolor option to set the
  368.      background color, you may now control the foreground color with -Fcolor,
  369.      and the title bar color with -Tcolor. Colors are either RGB values or
  370.      Xwindow color names, e.g.  _p_u_r_p_l_e.  (See _s_h_o_w_r_g_b for legal color names.)
  371.  
  372.      SGI specific "See Also" should include:  _o_s_v_i_e_w(_1), _n_p_r_i(_1), _r_e_a_l_t_i_m_e(_5),
  373.      and _s_c_h_e_d_c_t_l(_2).
  374.  
  375.      Several more sophisticated performance tools are optionally provided by
  376.      SGI notably PCP (the Performance CoPilot).
  377.  
  378.      Unlike other _t_o_p versions, the IRIX version should support thousands of
  379.      processors and an even larger number of processes.  Thus it avoids pre-
  380.      allocating a maximum size for process data.  In case the number of
  381.      processes grows too far a new initialization of data structures is
  382.      performed by the program restarting itself.  This restarting forgets any
  383.      interactive settings and may cause a change in the Weighted CPU%
  384.      averages.  This should be an extremely rare occurence but should be noted
  385.      here.
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. TTTTOOOOPPPP((((1111))))                                                                  TTTTOOOOPPPP((((1111))))
  401.  
  402.  
  403.  
  404. CCCCRRRREEEEDDDDIIIITTTTSSSS
  405.      Original porting to SGI/IRIX 5.x was done by Sandeep Cariapa.  Later
  406.      enhancements and further IRIX ports by Larry McVoy, John Schimmel, and
  407.      Ariel Faigon.
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.